package com.zmn.plat.admin.controller.push;

import com.google.common.collect.Lists;
import com.zmn.common.constant.GlobalConsts;
import com.zmn.common.dictionary.GlobalDict;
import com.zmn.common.dto.ResultDTO;
import com.zmn.common.dto.VtDTO;
import com.zmn.common.dto2.ResponseDTO;
import com.zmn.common.utils.collection.CollectionUtil;
import com.zmn.common.utils.logger.LoggerUtil;
import com.zmn.common.utils.office.ExcelUtil;
import com.zmn.common.utils.string.StringUtil;
import com.zmn.plat.common.exception.PlatException;
import com.zmn.plat.manager.dictionary.MasterDict;
import com.zmn.plat.model.vo.mast.ImageReslutDTO;
import com.zmn.plat.model.vo.push.PushNoticeAppVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/**
 * 描述: app公告逻辑控制器
 *
 * @author wangjie
 * @since 2020/3/23
 **/
@Slf4j
@RestController
@RequestMapping(value = "/push/noticeApp/ajax")
public class PushNoticeAjaxController extends PushNoticeAppBaseController {

    /**
     * 描述: 文件上传 （图片上传 为master模块提供文件上传）
     *
     * @param file      文件对象
     * @param elemId    元素id
     * @param timestamp 师傅id
     * @return com.zmn.common.dto.ImageUploadDTO
     * @author Yangk
     * @since 2020年11月9日
     */
    @RequestMapping(value = "uploaderImage")
    @ResponseBody
    public ImageReslutDTO uploaderImage(@RequestParam(value = "file") MultipartFile file,
                                        @RequestParam(value = "timestamp") String timestamp,
                                        @RequestParam(value = "elemId") String elemId) {

        return super.uploaderImage(file, MasterDict.MAST_MASTER_UPLOAD_IMAGES_PATH, elemId, timestamp);

    }

}
